/*
 * @time : 2022/5
 * @author : liyajun
 * @homepage : moreac.top
 */
#include <bits/stdc++.h>

const int INF = 0x3f3f3f3f;
const int N = 1e6 + 10;

using namespace std;
int n,m;
int h[N];
int find(int x)
{
	int cur = (x % N + N) % N;
	while(h[cur] != INF and h[cur] != x)
	{
		cur++;
		if(cur == N)cur = 0;
	}
	return cur;
}
void slove()
{
	cin >> n >> m;
	memset(h,0x3f,sizeof h);
	int x;
	for(int i = 1;i <= n;i++)
	{
		cin >> x;
		h[find(x)] = x;
	}
	while(m--)
	{
		cin >> x;
		if(h[find(x)] == INF) puts("NO");
		else puts("YES");
	}
	
}
int main() {
	int T = 1;
	//cin >> T;
	while(T--)slove();



	return 0;
}

